<template>
  <div>
    <el-tree
      :data="data"
      :props="defaultProps"
      highlight-current
      @node-click="handleNodeClick"
    >
    </el-tree>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data: [],
      defaultProps: {
        children: "children",
        label: "label",
        id: "id",
      },
    };
  },
  methods: {
    // el-tree获取父级节点
    handleNodeClick(data, node) {
      this.$emit("funRow", data);
      const curNode = node.parent.data;
      console.log(curNode, "curNode");
    },
  },
  created() {},
};
</script>

<style lang='scss' scoped>
</style>
